Hello, |
Re: Restore attribute to current module from a basline Redefine the attribute in the current module exactly as it is defined in the baseline version - attribute name must be exactly the same. Create a view in the baseline version that only shows the DOORS "Object Identifier" attribute and the attribute that you want to export to the current version. Make sure that no filters are enabled and that Deleted objects are not showing. Make sure that the column titles display the actual names of the underlying attributes. Export the view to Excel via the File->Export->Microsoft Office->Excel menu, then save the Excel file in a comma seperated variable (csv) file format. Import the csv file into the current module using the File->Import->Spreadsheet menu. The radio button options should be set to "By Column labels", Update Existing objects", "All objects" Browse for the csv file and select this as the Input File Select the Import button, choose the "Object Identifier" attribute as the unique import key. If DOORS raises a prompt that some objects were created after the import, then this suggests that the baseline version has some objects that are not in the current version (filter\look for objects where Object Text and Object Heading are empty). The current module could also have objects that are not in the baseline version (not easy to find these, perhaps filter\look for objects where where the value of the attribute that was being rebuilt is empty and confirm if they should have been empty, I'm sure there is a better way). It's recommended that you create a copy of the module and rehearse this first. Paul Miller, Melbourne, Australia |
Re: Restore attribute to current module from a basline SystemAdmin - Thu Sep 20 00:41:16 EDT 2012 Paul Miller, Melbourne, Australia Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Restore attribute to current module from a basline Mathias Mamsch - Thu Sep 20 04:52:46 EDT 2012 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS Thank you for the reply. After posting my question I found a script within "Kitchen" are there any issues related to this script. Thank you, -Jim |
Re: Restore attribute to current module from a basline SystemAdmin - Thu Sep 20 08:38:10 EDT 2012 :-) I would not trust ANY kitchen script. By the way implementing this yourself is very easy. Just to give some hints. Copying the attribute definition is very easy:
string sAttrName = "MyAttribute"
// copyops.inc defines 'copyAttrDefRename_ (AttrDef adSrc, Module modSrc, Module modTgt, string sNewName)
// load the baseline
Module modBaseline = load (...)
Module modTgt = current
if (!isEdit modTgt || ! canCreate modTgt) { ... }
AttrDef adSrc = find(modBaseline, sAttrName)
if (null adSrc) { /* inform user about missing attribute */ }
AttrDef adTgt = find (modTgt, sAttrName)
if (!null adTgt) { /* inform user that attribute exists, and ask if he wants to overwrite */
} else {
copyAttrDefRename_ (adSrc, modBaseline, modTgt, sAttrName)
}
And once the attribute exists copying over the values is a piece of cake:
Skip skSrc = create()
// cache the baseline objects for speed!
Object o;
for o in entire modBaseline do {
int nr = o."Absolute Number"
put (skSrc, nr, o)
}
// now copy the values
for o in entire modTgt do {
int nr = o."Absolute Number"
Object oBase = null
if (find(skSrc, nr, oBase)) {
if (isDeleted o) {
/* want to undelete the object before setting the value for DOORS 9
or just Skip that value
*/
continue
}
if (!canWrite (o.sAttrName)) { ... }
// copy the attribute value
set (o.sAttrName, oBase.sAttrName)
// copy doors pictures?
if (sAttrName == "Object Text") {
// insert copy picture code, if you want to copy DOORS picture objects
}
}
}
It should be that easy. I did not test the code, so typos, etc. are intended. Maybe this helps, regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|